#if !defined(AFX_2DMAPVIEW_H__92D54C3C_17DD_4DE4_B171_DFFBCCD5A01B__INCLUDED_)
#define AFX_2DMAPVIEW_H__92D54C3C_17DD_4DE4_B171_DFFBCCD5A01B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "2DScrollCam.h"
#include "Texture2D.h"
#include "Vector2f.h"

// 2DMapView.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// C2DMapView view

class C2DMapView : public COpenGLView
{
protected:
	C2DMapView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(C2DMapView)

// Attributes
public:
	CTerrainEditorDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(C2DMapView)
	public:
	virtual void OnInitialUpdate();
	protected:
	virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
	//}}AFX_VIRTUAL

	void VirtualOnCreate();
	void VirtualOnDraw();
	void VirtualOnSize(int width, int height);

// Implementation
protected:
	virtual ~C2DMapView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

// Member variables
public:
	CTexture2D		m_MapTexture;
	C2DScrollCam	m_2DCam;
	vector2f		m_vDefaultCamPos;
	CPoint			m_MousePosOnLBClick;
	bool			m_bMouseLBDown;
	bool			m_bMapLargerThanWindow;

private:
	HCURSOR			m_hMouseCursor;

	// Generated message map functions
protected:
	//{{AFX_MSG(C2DMapView)
	afx_msg void OnMenuItemPerlinNoise();
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnMenuItemOpenGLInfo();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in C2DMapView.cpp
inline CTerrainEditorDoc* C2DMapView::GetDocument()
   { return (CTerrainEditorDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_2DMAPVIEW_H__92D54C3C_17DD_4DE4_B171_DFFBCCD5A01B__INCLUDED_)
